<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../tpl/head.jsp"%>
<link rel="stylesheet" href="statics/css/secondarytitle.css">
<link rel="stylesheet" href="statics/css/Money/tpl/newupgeneral.css">
<div class="layui-fluid">
    <div class="layui-card">
        <div class="header">
            <img class="img " src="statics/images/titheader.svg">
            <span id="billingType"></span>
        </div>
        <div class="layui-card-body">
            <form class="layui-form" action="" lay-filter="editor-form" id="editor-form">
                <input id="sourceType" name="sourceType" type="hidden">
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label xb_required">开票编号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="code" id="code" autocomplete="off" class="layui-input"  readonly="readonly"  lay-verify="required">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">联系人</label>
                        <div class="layui-input-inline">
                            <input type="text" name="contactName" id="contactName" autocomplete="off" class="layui-input"  lay-verify="required">
                            <input type="hidden" name="contactCode" id="contactCode">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label xb_required" id="vendorANDCustomerName"></label>
                        <div class="layui-input-inline">
                            <input type="text" name="manufacturerName" id="manufacturerName" autocomplete="off" class="layui-input"  lay-verify="required">
                            <input type="hidden" name="manufacturerCode" id="manufacturerCode" >
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label" id="billingDateName"></label>
                        <div class="layui-input-inline">
                            <div class="layui-input-inline">
                                <input type="text" name="billingDate" autocomplete="off" class="layui-input starttime" placeholder="年 - 月 - 日">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label" id="exportContentANDInvoiceCode"></label>
                        <div class="layui-input-inline">
                            <input type="text" name="declarationInvoiceCode" id="declarationInvoiceCode" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label xb_required">币种</label>
                        <div class="layui-input-inline">
                            <select lay-search name="currencyCode" id="currencyCode" lay-filter="currencyCode" lay-verify="required">
                                <option value=""></option>
                            </select>
                            <input type="hidden" name="currencyName" id="currency">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">美金汇率</label>
                        <div class="layui-input-inline">
                            <input type="text" name="usdRate" id="usdRate" autocomplete="off" class="layui-input" lay-verify="number">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">人民币汇率</label>
                        <div class="layui-input-inline">
                            <input type="text" name="rmbRate" id="rmbRate" autocomplete="off" class="layui-input" lay-verify="number">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">开票总额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="totalInvoicedAmount" id="totalInvoicedAmount" autocomplete="off" class="layui-input" lay-verify="required|number">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">通知金额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="notificationAmount" id="notificationAmount" onblur="calculation();"  autocomplete="off" class="layui-input" lay-verify="number">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">已开金额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="openedAmount" id="openedAmount" onblur="calculation();" autocomplete="off" class="layui-input" lay-verify="number">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">未开金额</label>
                        <div class="layui-input-inline">
                            <input type="text" name="uncommittedAmount" id="uncommittedAmount" autocomplete="off" class="layui-input" lay-verify="number">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">系统创建日期</label>
                        <div class="layui-input-inline">
                            <input type="text" name="createDate" id="createDate" readonly autocomplete="off" class="layui-input" lay-verify="required">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">开票抬头</label>
                        <div class="layui-input-inline">
                            <select lay-search name="billingTowerHeadCode" id="billingTowerHeadCode" lay-filter="billingTowerHeadCode_filter" lay-verify="required">
                                <option value=""></option>
                            </select>
                            <input type="hidden" name="billingTowerHeadName" id="billingTowerHeadName">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">开票银行</label>
                        <div class="layui-input-inline">
                            <select lay-search name="bankName" id="bankName" lay-filter="bankNameFilter">
                                <option value=""></option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">操作员</label>
                        <div class="layui-input-inline">
                            <input type="hidden" name="operatorCode" id="operatorCode">
                            <input type="text" name="operatorName" id="operatorName" readonly="readonly" autocomplete="off" class="layui-input" lay-verify="required">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item zdy-item-css">
                    <div class="layui-inline">
                        <label class="layui-form-label">增票号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="increaseCode" id="increaseCode" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">报关单号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="billDeclareInvoiceNo" id="billDeclareInvoiceNo" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea name="description" placeholder="请输入内容" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">开票明细</li>
                                <li class="">附件</li>
                                <li class="">日志</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div  class="layui-tab-item  layui-show">
                                    <table class="layui-table" id="moaidetail" lay-filter="moaidetailtable"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-table" id="attachment" lay-filter="attachmenttable"></table>
                                </div>
                                <div class="layui-tab-item"><table class="layui-table" id="otherwarehouselog" lay-filter="logtable"></table></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="padding text-right">
                    <button type="button" class="layui-btn" lay-submit="" lay-filter="form-element">立即提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="layui-upload" id="attachmentupload" style="display: none;padding: 10px">
    <a type="button" class="layui-btn layui-btn-normal" id="uploadfile">选择文件</a>
    <div class="layui-upload-list">
        <table class="layui-table">
            <thead>
            <tr><th>文件名</th>
                <th>大小</th>
                <th>状态</th>
                <th>操作</th>
            </tr></thead>
            <tbody id="uploadlist"></tbody>
        </table>
    </div>
    <a type="button" class="layui-btn" id="testListAction">开始上传</a>
</div>
<script type="text/html" id="imgTpl">
    <img src="{{d.productimg}}" data-id="{{d.id}}" class="btn_productimg" onerror="this.src='statics/images/layui-logo.jpg';this.onerror=null" alt="产品图片" style="max-width:70px;max-height: 28px;">
</script>

<script type="text/html" id="customscodeselect">
    <div class="layui-input-inline">
        <div class="layui-form-select ySearchSelect y_{{d.id}}" data-id="{{d.id}}">
            <div class="layui-input">{{d.customscode==undefined?"":d.customscode}}</div>
            <i class="layui-edge"></i>
            <table class="layui-table zdy" id="customscodeselect_{{d.id}}" lay-filter="customscodeselecttable_{{d.id}}"></table>
        </div>
    </div>
</script>

<script type="text/html" id="unitSelect">
    <select name="goodsUnit" class="goodsUnit" id="goodsUnit_{{d.tempId}}" lay-filter="goodsUnit_filter">
        <option value=""></option>
    </select>
</script>

<script type="text/html" id="moaidetailtoolbar">
    {{# if(sourceType == 1){ }}
        <a class="layui-btn" data-type="getCheckData" lay-event="imporcustomsdeclarationform" id="imporcustomsdeclarationform">导入报关单（厂商分组）</a>
        <a class="layui-btn" lay-event="importPurchaseContract" id="importPurchaseContract">导入采购合同</a>
        <a class="layui-btn" lay-event="importCarryDetail" id="importCarryDetail">导入出运明细</a>
    {{# } }}

    {{# if(sourceType == 2){ }}
        <a class="layui-btn" lay-event="importExportContract" id="importExportContract">导入外销合同</a>
        <a class="layui-btn" lay-event="importBillExchange" id="importBillExchange">导入结汇单据</a>
        <a class="layui-btn" lay-event="importCarryDetail" id="importCarryDetail">导入出运明细</a>
    {{# } }}

    <a class="layui-btn layui-btn-danger" lay-event="del">删除</a>
</script>
<script type="text/html" id="moaidetaileditor">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script type="text/html" id="attachmenttoolbar">
    <a class="layui-btn" data-type="getCheckData" lay-event="uploadfile">上传</a>
</script>
<script type="text/html" id="attachmenteditor">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="download">下载</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<%@ include file="../../tpl/foot.jsp"%>
<script src="statics/js/bignumber.js"></script>
<script src="statics/js/Money/tpl/newupmakeoutaninvoice.js"></script>
